import 'package:firebase_auth/firebase_auth.dart';
import 'package:fluttertoast/fluttertoast.dart';
// import 'package:google_sign_in/google_sign_in.dart';

class GoogleLoginUtil {
  static final FirebaseAuth _auth = FirebaseAuth.instance;
  // static final GoogleSignIn _googleSignIn = GoogleSignIn();

  /// google登录
  // static Future<String?> signInWithGoogle() async {
  //   try {
  //     final GoogleSignInAccount? googleUser = await _googleSignIn.signIn();
  //     if (googleUser != null) {
  //
  //       Fluttertoast.showToast(msg: "Welcome back!");
  //       final GoogleSignInAuthentication googleAuth = await googleUser.authentication;
  //       return googleAuth.accessToken;
  //     }
  //   } catch (e) {
  //     Fluttertoast.showToast(msg: "Welcome back!");
  //   }
  //   return null;
  // }


  ///获取当前用户
  static User? currentUser() {
    return _auth.currentUser;
  }

  /// sign out.
  static Future<void> signOut() async {
    await _auth.signOut();
    // await _googleSignIn.signOut();
  }
}
